#include<iostream>
#define MAX 1000
using namespace std;

int numbers[MAX+1];
int n;
int swaps;

void sort() {
   for(int i=1; i<n; i++) {
      for(int j=0; j<n-1; j++) {
         if(numbers[j]>numbers[j+1]) {
            int temp = numbers[j];
            numbers[j] = numbers[j+1];
            numbers[j+1] = temp;
            swaps++;
         }
      }
   }   
}

void read() {
   while(cin >> n) {
      swaps = 0;
      for(int i=0; i<n; i++)
         cin >> numbers[i];
      sort();
      cout << "Minimum exchange operations : " << swaps << endl;
   }
}

int main() {
   read();  
   return 0;
}
